/*
 * @Author: zhangtengyue 2441004366@qq.com
 * @Date: 2024-12-14 11:30:22
 * @LastEditors: zhangtengyue 2441004366@qq.com
 * @LastEditTime: 2024-12-17 16:07:18
 * @FilePath: \vite-vben-admin\src\views\demo\system\dict\dictdetail.data.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { BasicColumn, FormSchema } from '/@/components/Table';

// 表格列配置
export const columns: BasicColumn[] = [
  {
    title: '序号',
    dataIndex: 'dictId',
    width: 120,
  },
  {
    title: '字典标签',
    dataIndex: 'dictTag',
    width: 120,
  },
  {
    title: '字典键值',
    dataIndex: 'dictValue',
    width: 120,
  },
  {
    title: '字典排序',
    dataIndex: 'dictSort',
    width: 100,
  },
  {
    title: '状态',
    dataIndex: 'status',
    width: 100,
  },
  {
    title: '备注',
    dataIndex: 'remark',
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    width: 180,
  },
];

// 搜索表单配置
export const searchFormSchema: FormSchema[] = [
  {
    field: 'dictName',
    label: '字典键名',
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    field: 'status',
    label: '状态',
    component: 'Select',
    componentProps: {
      options: [
        { label: '启用', value: 'enabled' },
        { label: '禁用', value: 'disabled' },
      ],
    },
    colProps: { span: 8 },
  },
];

// dictdetail.data.ts
export const dictDetailFormSchema: FormSchema[] = [
  {
    field: 'dictTag',
    label: '字典标签',
    component: 'Input',
    required: true,
  },
  {
    field: 'dictValue',
    label: '字典键值',
    component: 'Input',
    required: true,
  },
  {
    field: 'dictSort',
    label: '字典排序',
    component: 'InputNumber',
    required: true,
  },
  {
    field: 'status',
    label: '状态',
    component: 'RadioButtonGroup',
    componentProps: {
      options: [
        { label: '启用', value: 'enabled' },
        { label: '禁用', value: 'disabled' },
      ],
    },
    required: true,
  },
  {
    field: 'remark',
    label: '备注',
    component: 'InputTextArea', // 使用多行输入框组件
    componentProps: {
      placeholder: '请输入备注信息',
      rows: 4, // 设置多行输入框的行数
    },
  },
];
